#include "zygscrollarea.h"

ZygScrollArea::ZygScrollArea(){}

ZygScrollArea::ZygScrollArea(QMainWindow* mainWindow) : QScrollArea(mainWindow){
    //创建画布
    this-> canvas = new ZygCanvas(this);

    // 背景色
//    this->setBackgroundRole(QPalette::Highlight);
    // 区域大小
    int startX = 0;
    int startY = mainWindow->menuBar()->height();
    int width = mainWindow->width();
    int height = mainWindow->height() - mainWindow->menuBar()->height();
    this->setGeometry(startX,startY,width,height);
    // 居中对齐
//    this->setAlignment(Qt::AlignCenter);
    // 绑定画布
    this->setWidget(this->canvas);
}


ZygScrollArea::~ZygScrollArea(){
    delete this->canvas;
}

void ZygScrollArea::refreshContent(){
    this->canvas->displayTimer();
}
